package com.example.taco.bean;


import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.hibernate.validator.constraints.CreditCardNumber;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@RequiredArgsConstructor
public class Order {

    @NotBlank(message = "不要填空值")
    private String name;

    @NotBlank(message = "不要填空值")
    private String street;

    @NotBlank(message = "不要填空值")
    private String city;

    @NotBlank(message = "不要填空值")
    private String state;

    @NotBlank(message = "不要填空值")
    private String zip;

    @CreditCardNumber(message = "不符合")
    private String ccNumber;

    @Pattern(regexp = "^(0[1-9]|1[0-2])([\\/]([1-9][0-9]))$",message = "MM/YY")
    private String ccException;

    @Digits(integer = 3,fraction = 0,message = "不符合尺寸CVV")
    private String ccCVV;
}
